                                                      /********************************************************
  *      Real Time Clock DS1307 Library for 18F4620     *
  *                  (for PIC IC.)                      *
  *                 by Deniz ELMASLI                    *
  * Version 2.0                                         *
  * Creation Date: 28.12.2008   -   10:12 Friday        *
  * Revision Date: 08.06.2008   -   03:42 Saturday      *
  * Ide(s) : Code::Blocks v1.0 (C++ developement)       *
  *          MikroC V7.0                                *
  * Target Platform: PIC                                *
  * MCU : 18F4620                                       *
  * Contact: elmasli@gmail.com                          *
  * Web    : www.dronology.com                          *
  *                                                     *
  *   This code in intended to work with PIC IC. This   *
  * source code contains functions to drive DS1307 real *
  * time clock  . I2C Functions used in ver2.0          *
  *******************************************************

*/
#ifndef __RFRemoteDecode_H__
#define __RFRemoteDecode_H__

 typedef enum RFRemoteDecode_State { RFRemoteDecode_Detect_Sync_Bit,
                                     RFRemoteDecode_Detect_Min_High_Pulse,
                                     RFRemoteDecode_Detect_AddrnDat,
                                     RFRemoteDecode_Process_Button,
                                     RFRemoteDecode_Establish_Code,
                                     RFRemoteDecode_Control_Actuators,
                                   } _RFRemoteDecode_State;
                                   
 typedef enum Learningmode         { SingleONOFF,
                                     AllON,
                                     AllOFF,
                                     Clearance,
                                   }_Learningmode;


 #define       RFTransceiver_BIT_0           0b00010001      /* 17  encoded -> 0*/
 #define       RFTransceiver_BIT_1           0b01110111      /* 119 encoded -> 1*/
 #define       RFTransceiver_BIT_F           0b01110001      /* 113 encoded -> 2*/
 #define       RFTransceiver_BIT_F_Extend    0b00010111      /* 23  encoded -> 3*/
 
 /*
 RFTransceiver_BIT_F_Extend  is used to encrypt EV1527 and PT2240
 */
 

 #define       PRESS                                  0
 #define       RELEASE                                1

 #define       OK                                     1
 #define       NOT_OK                                 0
 // Prescaler of timer0 is 256, Max Tmr_cnt 's 256 and because,
 //2 second = 2000000us/( 256*256)/2 = 61
 
 #define       FIVE_HUNDRED_MS                      8
 #define       ONE_HUNDREDnFITTY                    5
 #define       TWO_SECOND                           61
 #define       FOUR_SECOND                          122
 #define       SIX_SECOND                           183
 #define       EIGHT_SECOND                         244
 #define       TEN_SECOND                           305
 
 
 unsigned long RFRemoteDecode_GetAddr  ( unsigned short * RFRemoteBuff);
 unsigned int RFRemoteDecode_GetData   ( unsigned short * RFRemoteBuff);
 
#endif
/**************************End of file*****************************************/